import request from '../request.js'

// 星河列表
export function xingheList(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/list", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 山海地区 
export function dianhua(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/appversion/dianhua", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 创建星球
export function create(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/add", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 编辑星球
export function edit(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/edit", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 创建讨论
export function createDiscuss(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/create_discuss", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 编辑讨论
export function update_discuss(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/update_discuss", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 星球详情 
export function Detail(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/detail", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
//星球详情列表
export function discussList(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/detail_discuss_list", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 星球详情 关注
export function collect(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/collect", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 
// 星球详情 加入
export function jiaru(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/jiaru", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球详情 讨论组详情
export function discussDetail(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/discuss_detail", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 
// 星球讨论组详情-下边回复点赞等
export function huifuDianzan(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/huifu_dianzan", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 
// 星球讨论组详情-下边回复的子回复
export function huifuChildren(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/huifu_children", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 

// 星球 送礼物
export function sendGift(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/send_gift", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 

// 星球详情-点赞
export function likeDiscuss(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/like_discuss", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 

// 星球详情-发送消息 
export function huifuDiscuss(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/huifu_discuss", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
} 
// 星球详情-收藏 
export function shoucang(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/shoucang", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球详情-收藏 
export function userList(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/user_list", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 用户星球-设置身份
export function setShenfen(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/set_shenfen", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球用户-拉黑 
export function lahei(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/lahei", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球用户-禁言
export function jinyan(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/jinyan", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球用户-解除禁言 
export function jiechujinyan(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/jiechujinyan", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 星球用户-解除拉黑
export function jiechulahei(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/jiechulahei", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// http://192.168.0.139:263/api/xinghe/search_user
// 星球用户-邀请用户查询
export function searchUser(params) {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/search_user", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}
// 星球用户-邀请用户
export function yaoqing(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/yaoqing", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}
//http://192.168.0.139:263/api/xinghe/tichu
// 星球用户-踢人
export function tichu(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/tichu", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}
// 星球用户-获取余额
export function point_yue(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/point_yue", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}

// 星球用户-奖励积分 
export function point_send(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/send_point", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}
// 星球用户-扣除积分 
export function point_deduct(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/deduct_point", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}
// 用户星球-删除讨论组 
export function delete_discuss(params) {
    return new Promise((resolve, reject)=>{
        request.post("/api/xinghe/delete_discuss", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
    });
}

// 星球用户-讨论组置顶 
export function discuss_zhiding(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/discuss_zhiding", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}
// 星球用户-讨论组取消置顶 
export function quxiao_discuss_zhiding(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/quxiao_discuss_zhiding", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}

// 星球用户-回复置顶
export function huifu_zhiding(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/huifu_zhiding", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}

// 星球用户-回复置顶取消
export function quxiao_huifu_zhiding(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/xinghe/quxiao_huifu_zhiding", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}


// 首页-今日更新星球
export function xingqiuHome(params)  {
    return new Promise((resolve, reject)=>{
        request.get("/api/page/xingqiu", params).then((result)=>{
            resolve(result)
        }).catch(err=>{
            reject(err)
        });
});
}